{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f5\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f6\fnil\fprq2\fcharset0 MS Mincho;}{\f7\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af6\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
}
{\info{\creatim\yr2011\mo7\dy19\hr6\min24}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Content;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Core;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Graphics;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Math;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 namespace TeslaSamples.Renderer \{}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 [AppDescription("Vertex Buffer Sample", PlatformCapabilities.Direct3D10 | PlatformCapabilities.XNA4, "VertexBufferImage", "VertexBufferDesc", "VertexBufferSource")]}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 public class VertexBufferSample : BasicApp \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private VertexBuffer geom;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private IndexBuffer indices;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private Effect effect;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 protected override void LoadContent() \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 ClearColor = Color.CornflowerBlue;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 Window.Title = "Simple example showing how to use graphics objects directly to render geometry.";}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Let's create a quad}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 DataBuffer<Vector3> verts = new DataBuffer<Vector3>(4);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 verts.Set(new Vector3(-1, 1, 0));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 verts.Set(new Vector3(1, 1, 0));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 verts.Set(new Vector3(1, -1, 0));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 verts.Set(new Vector3(-1, -1, 0));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 DataBuffer<Vector3> norms = new DataBuffer<Vector3>(4);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 norms.Set(new Vector3(0, 0, 1));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 norms.Set(new Vector3(0, 0, 1));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 norms.Set(new Vector3(0, 0, 1));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 norms.Set(new Vector3(0, 0, 1));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //We use the DataBuffers (which are more or less a wrapper for an array,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //and provide a generic way of accessing byte data for multiple data types)}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Since VertexBuffer can take in an array of them to set interleaved data, so}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //we don't have to do it ourself. This can easily be done using a single array}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //of a custom vertex struct (e.g. VertexPositionNormal struct).}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Setup our vertex buffer, this is the sort of functionality that}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Mesh and MeshData does behind the scenes.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 VertexDeclaration decl = new VertexDeclaration(new VertexElement[] \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 new VertexElement(VertexSemantic.Position, 0, VertexFormat.Vector3, 0),}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 new VertexElement(VertexSemantic.Normal, 0, VertexFormat.Vector3, 12),}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \});}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 geom = new VertexBuffer(decl, 4, ResourceUsage.Static);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 geom.SetInterleavedData(verts, norms);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Since we're building a quad (two triangles) but only specified four vertices,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //we need to setup an index buffer.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 indices = new IndexBuffer(IndexFormat.SixteenBits, 6, ResourceUsage.Static);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Clockwise winding (default vertex winding)}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 indices.SetData<short>(new short[] \{ 0, 1, 2, 0, 2, 3 \});}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Our geometry is now setup, but to render it we need to setup an effect,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //so we'll load up one of the compiled shaders that comes with the engine.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //The specific implementations of the engine's shader library are}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //embedded in those DLL's and are served via the render system's default}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //content manager.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect = ContentManager.Load<Effect>("LitBasicEffect.tebo").Clone();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.CurrentTechnique = effect.Techniques["LitBasicColor"];}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.Parameters["MatDiffuse"].SetValue(Color.Crimson.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //This effect expects a light to render properly, so we need to manually set it}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 PointLight pl = new PointLight();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 pl.Position = new Vector3(0, 0, 50);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 pl.Attenuate = false;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.Parameters.GetParameterBySemantic("LIGHTCOUNT").SetValue(1);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 SetLight(effect.Parameters.GetParameterBySemantic("LIGHTLIST").Elements[0], pl);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //This code is taken directly from the lighting logic that is}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //used by the material. Since the scene graph's Mesh class is an IRenderable,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //it has a material exposed to the renderer. When the material is applied (render states set,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //logic executed, pass applied), this logic checks if the light collection has been}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //changed since the last time the renderable was rendered. If it has been, light data}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //is sent to the shader.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private void SetLight(IEffectParameter lParam, PointLight pl) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[0].SetValue(pl.Ambient.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[1].SetValue(pl.Diffuse.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[2].SetValue(pl.Specular.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[3].SetValue(pl.Attenuate);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[4].SetValue(pl.Constant);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[5].SetValue(pl.Linear);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[6].SetValue(pl.Quadratic);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[7].SetValue(new Vector4(pl.Position, 0));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[8].SetValue(Vector3.Down);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[9].SetValue(0f);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 lParam.StructureMembers[10].SetValue(0f);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Called by BasicApp during Render(), in between clearing the swapchain}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //and presenting the backbuffer.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 protected override void OnRender(IRenderer renderer) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //This is what the scene graph does before a mesh is rendered. We update}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //the engine value map with the mesh's compiled world matrix.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 Engine.ValueMap.WorldMatrix = Matrix.FromScale(25f) * Matrix.FromTranslation(new Vector3(0, 10, 0));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //The engine value system tracks values across the engine such as the W-V-P}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //matrices or current engine time, when a material is applied these values}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //automatically are sent to the shader.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.Parameters["WVP"].SetValue(Engine.ValueMap.WorldViewProjection);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //We use the world matrix inverse transpose to deal with non-uniform scaling}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //opposed to just using the world matrix (for lighting calculations).}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.Parameters["WorldIT"].SetValue(Engine.ValueMap.WorldInverseTranspose);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.Parameters["EyePos"].SetValue(renderer.CurrentCamera.Position);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Note - the above shows what internally happens, the same could be}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //done by creating the view/projection matrices (the above are from the renderer's camera}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //created in the super class) and concatenating them.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 effect.CurrentTechnique.Passes[0].Apply();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //The engine's policy regarding render states is "apply only the states you need",}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //which tends to be the most efficient method. States applied are cached, to}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //prevent redundant state switching. If you set RasterizerState.CullNone twice}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //it only actually is applied once. This is important when using the render queue,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //since renderables with similar materials (shader, textures, render states)}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //are sorted to be grouped together.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Although we are not using materials here, if no render states are set,}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //then the default engine states are applied (see those classes for their}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //default state).}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 renderer.RasterizerState = RasterizerState.CullNone;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Now setup the draw call}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 renderer.SetVertexBuffer(geom);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 renderer.SetIndexBuffer(indices);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 renderer.DrawIndexed(PrimitiveType.TriangleList, indices.IndexCount, 0, 0);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 \}}
\par }